<?
/**
* Copyright (c) 2002-2007 BioWare Corp.
* http://www.bigdaddymonitor.org
*
* This file is part of the BigDaddy Monitoring
* program. It is free software distributed under
* the terms of the BSD License. It is ditributed
* in the hopes that it will be useful, but
* WITHOUT ANY WARRANTY; without event the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE.
*
* The BSD License is available from:
* http://www.opensource.org/licenses/bsd-license.php
**/
$aAccess = $Role->GetRolesByTypeStringID("access");


$sql="SELECT * FROM treeEntry WHERE ID='".$_REQUEST["entryID"]."'";
$entryInfo=mysql_fetch_array(run_mysql_query($sql));

/*
 Get the RoleIDs that are attached to this entry.
 Break them apart into an array
*/
$aRole=explode(":", $entryInfo["roleID"]);

if ($entryInfo["parentID"]=="" || $entryInfo["parentID"]==0)
{
    ?>
    <p>You are entering a root entry for the Treeview</p>
    <?
}
else
{
    $rootPath=rootEntryPathCreate($entryInfo["parentID"]);
    ?>
    <p>This entry will be a sub entry for <b>BioWare Home / <?=$rootPath;?></b></p>
    <?
}
?>

<form method="post" action="query_treeview.php">

<table border="0" cellpadding="5" cellspacing="1" width="100%" >
<tr align="left" valign="top">
<td>

<table border="0" cellpadding="5" cellspacing="1" width="500" class="tablecolor1">
<tr align="left">
	<td width="25%" class="tablecolor2"><b>Name: </b></td>
	<td class="tablecolor3"><input type="text" name="name" value="<?=$entryInfo["name"];?>" size="50" />
	<br />
	<br />
	<span class="smalltext">The actual name of the link to appear on the Treeview </span></td>
</tr>
<tr align="left">
	<td width="25%" class="tablecolor2"><b>Link: </b></td>
	<td class="tablecolor3"><input type="text" name="link" value="<?=$entryInfo["link"];?>" size="50" />
	<br />
	<br />
	<span class="smalltext">The URL for this link</span>
	</td>
</tr>
<tr>
	<td  colspan="2" align="center" class="maintable">
	<input type="hidden" name="entryID" value="<?=$entryInfo["ID"];?>" />
	<input type="hidden" name="action" value="editEntry" />
	<input type="submit" name="submit" value="Edit Entry" />
	</td>
</tr>
</table>

</td>
<td>

<table border="0" cellpadding="5" cellspacing="1" class="tablecolor1">
<tr align="left">
<td class="tablecolor1" colspan="2">
<p><b>Access Restrictions.</b><br />
<span class="smalltext">If you want everyone to have access, do not choose any specific department/project or group.</span>
</p>
</td>
</tr>

<tr align="left" valign="top">
	<td class="tablecolor2"><b>Group Access: </b></td>
</tr>
<tr align="left" valign="top">
	<td class="tablecolor3">
	
	<?
	
	for ($i = 0; $i < count($aAccess); $i++)
	{
		$c="";
		$class="";
		if (in_array($aAccess[$i]["ID"], $aRole))
		{
			$c=" checked";
			$class="highlight";
		}
	?>
		<input type="checkbox" name="roleID[]" value="<?=$aAccess[$i]["ID"];?>" <?=$c;?> /><span class="smalltext"><span class="<?=$class;?>"><?=$aAccess[$i]["name"];?></span></span><br />
	<?
	}

	?>
	
	</td>

</tr>
</table>

</td>
</tr>
</table>

</form>

